package org.jeecg.modules.qy.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.collections.CollectionUtils;
import org.jeecg.modules.qy.entity.QyCommodityCheck;
import org.jeecg.modules.qy.mapper.QyCommodityCheckMapper;
import org.jeecg.modules.qy.service.IQyCommodityCheckService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 检测报告
 * @Author: jeecg-boot
 * @Date:   2021-03-10
 * @Version: V1.0
 */
@Service
public class QyCommodityCheckServiceImpl extends ServiceImpl<QyCommodityCheckMapper, QyCommodityCheck> implements IQyCommodityCheckService {

    @Override
    public QyCommodityCheck getByCommodityId(String commodityId){
        List<QyCommodityCheck> checkList = list(new QueryWrapper<QyCommodityCheck>().eq("commodity_id",commodityId));
        return CollectionUtils.isNotEmpty(checkList)?checkList.get(0):null;
    }
}
